<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .container {
  width: 200px;
  height: 200px;
  display: flex;
}

.left,
.right {
  flex: 0 0 auto;
  width: 50px;
  height: 100%;
}

.middle {
  flex: 1 1 auto;
  height: 100%;
}

.red {
  background-color: red;
}

.blue {
  background-color: blue;
}
</style>
<body>
  <!-- [css] 使用flex实现三栏布局，两边固定，中间自适应 -->
  <div class="container">
    <section class="left red"></section>
    <section class="middle blue"></section>
    <section class="right red"></section>
  </div>
  <!-- https://juejin.cn/post/6844904182156115982 -->
</body>
</html>